Basic Programming Concepts

Last reviewed 25 Jan 2021 by Crispin Read

Description

This session will introduce the learners to Javascript. They will learn about variables/ data types, the console and arithmetic operators

Why this is important

This session will show the learners how to lay out their code and structure simple functional programmes. The purpose of this lesson is to help the learners understand how to think like a programmer/ talk to a computer.

Outcomes

Following this training you will be able to: Create very basic procedural code and explain the differences between the different data types and arithmetic operators available.

Learner Requirements

VS code

Github desktop

Outline

  1. What is Javascript?
  2. What can you do with Javascript
  3. How to apply Javascript to your website code
  4. Output methods
  5. Variables, Data types and Mathematical operators
  6. Task

Tasks

Mandatory

1 We’ll make a program to calculate a tip

  1. Create variables for the pre-tip total and the tip percentage
  2. Calculate the new total
  3. Output a sentence to the page - something like:

Your total bill, with tip, is £35.45

BONUS POINTS:

  1. Use toFixed() to round the output to 2 decimal places
  2. Display the tip amount in the output as well

2 Extend the Tip program

  1. Create variables for the pre-tip total and the tip percentage
  2. Calculate the new total
  3. Output a sentence to the page - something like:

“Your total bill, with tip, is £35.45”

Extension: round the figure to 2 DP and display the tip amount.

Additional

Make a Procedural Function in Javascript.

Resources / Reference

N/A

Skills, Knowledge, Behaviours and Values

Core Skills

This workshop is designed to develop the following from our core skills directive

  • Presentation
  • Logic
  • Problem Solving
  • Reflection
  • Research
  • Learning from failure

Apprenticeship Standard

This workshop will encourage the development of the following from the Software Developer Level 4 Standard

COMPETENCIES (Skills)

  • C1 - Logic: writes good quality code (logic) with sound syntax in at least one language.
  • C5 - Problem solving: can apply structured techniques to problem solving, can debug code and can understand the structure of programmes in order to identify and resolve issues.
  • C8 - Deployment: can understand and utilise skills to build, manage and deploy code into enterprise environments.
  • C9 - Development lifecycle: can operate at all stages of the software development lifecycle, with increasing breadth and depth over time with initial focus on build and test..
  • C12 - Can respond to the business environment and business issues related to software development.

BEHAVIOURS

  • B1 - Logical and creative thinking skills.
  • B2 - Analytical and problem-solving skills.
  • B3 - Ability to work independently and to take responsibility.
  • B7 - Ability to communicate effectively in a variety of situations.
  • B8 - Maintain productive, professional and secure working environment.

Knowledge

  • K1 - Understands and operates at all stages of the software development lifecycle.
  • K3 - Understands how teams work effectively to produce software and contributes appropriately.
  • K4 - Understands and applies software design approaches and patterns and can interpret and implement a given design, compliant with security and maintainability requirements.
  • K5 - Understands and responds to the business environment and business issues related to software development.